﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Sunboxsoft.WinForm;
using WebRef = Sunboxsoft.ASMS.Client.Domain.WebRef;
using Service = Sunboxsoft.ASMS.Client.Domain.Service;
namespace Sunboxsoft.ASMS.Client.UI.Components
{
    public partial class ShowCheckedOutView : UserControl, IView
    {
        #region Property
        /// <summary>
        /// 结算单
        /// </summary>
        WebRef.VSettlementBill bill = null;
        /// <summary>
        /// 支付方式列表
        /// </summary>
        List<WebRef.VPayRecord> list = null;
        #endregion

        #region Method
        public ShowCheckedOutView()
        {
            InitializeComponent();
        }
        public ShowCheckedOutView(WebRef.VSettlementBill bill, List<WebRef.VPayRecord> list)
        {
            InitializeComponent();
            this.list = list;
            this.bill = bill;
            BindPayRecord();
        }
        /// <summary>
        /// 绑定支付信息
        /// </summary>
        private void BindPayRecord()
        {
            this.txtActualAmount.Text = bill.Amount.ToString();
            this.txtGZAmount.Text = "0";
            this.txtTicketType.Text = bill.InvoiceTypeName;
            this.txtTicketNum.Text = bill.InvoiceNumber;
            this.txtCashMan.EditValue = bill.CashierName;
            this.txtCashTime.Text = bill.PaidTime.ToString();
            this.txtCashRemark.Text = bill.CheckOutMemo;
            this.GCPayWay.DataSource = list;
        }
        #endregion

        #region IView 成员
        public void RegisterAction(ActionNodeCollection collection)
        {

        }
        public void Resume(ViewResumeArgs args)
        {
        }
        public void Active(ViewActiveArgs args)
        {
        }
        public ViewHeader GetHeader()
        {
            return new ViewHeader("");
        }
        #endregion
    }
}
